package com.sfddata.musicpillow.user.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;

/**
 * 
 * @TableName sleep_score_table
 */
@TableName(value ="sleep_score_table")
@Data
@AllArgsConstructor
public class SleepScoreTable implements Serializable {
    /**
     * 
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 
     */

    private Integer userid;

    /**
     * 
     */

    private Integer sleep;

    /**
     * 
     */
    private Integer press;

    /**
     * 
     */
    private Double eat;

    /**
     * 
     */
    private Double sport;

    /**
     * 
     */
    private Double body;

    /**
     * 
     */
    private Double habit;

    /**
     * 
     */
    private Double score;

    /**
     * 
     */
    private String age;

    private String answer;

    private String showList;

    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern="yyyy-MM-dd")
    private Date createTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    public SleepScoreTable(Integer id, Integer sleep, Integer press, Double eat, Double sport, Double body, double v, double v1, String age, String answer, List<String> show
    ) {


        this.userid = id;
        this.sleep = sleep;
        this.press = press;
        this.eat = eat;
        this.sport = sport;
        this.body = body;
        this.habit = v;
        this.score = v1;
        this.age = age;
        this.answer = answer;
        this.showList = show.toString();
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        SleepScoreTable other = (SleepScoreTable) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getUserid() == null ? other.getUserid() == null : this.getUserid().equals(other.getUserid()))
            && (this.getSleep() == null ? other.getSleep() == null : this.getSleep().equals(other.getSleep()))
            && (this.getPress() == null ? other.getPress() == null : this.getPress().equals(other.getPress()))
            && (this.getEat() == null ? other.getEat() == null : this.getEat().equals(other.getEat()))
            && (this.getSport() == null ? other.getSport() == null : this.getSport().equals(other.getSport()))
            && (this.getBody() == null ? other.getBody() == null : this.getBody().equals(other.getBody()))
            && (this.getHabit() == null ? other.getHabit() == null : this.getHabit().equals(other.getHabit()))
            && (this.getScore() == null ? other.getScore() == null : this.getScore().equals(other.getScore()))
            && (this.getAge() == null ? other.getAge() == null : this.getAge().equals(other.getAge()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getUserid() == null) ? 0 : getUserid().hashCode());
        result = prime * result + ((getSleep() == null) ? 0 : getSleep().hashCode());
        result = prime * result + ((getPress() == null) ? 0 : getPress().hashCode());
        result = prime * result + ((getEat() == null) ? 0 : getEat().hashCode());
        result = prime * result + ((getSport() == null) ? 0 : getSport().hashCode());
        result = prime * result + ((getBody() == null) ? 0 : getBody().hashCode());
        result = prime * result + ((getHabit() == null) ? 0 : getHabit().hashCode());
        result = prime * result + ((getScore() == null) ? 0 : getScore().hashCode());
        result = prime * result + ((getAge() == null) ? 0 : getAge().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", userid=").append(userid);
        sb.append(", sleep=").append(sleep);
        sb.append(", press=").append(press);
        sb.append(", eat=").append(eat);
        sb.append(", sport=").append(sport);
        sb.append(", body=").append(body);
        sb.append(", habit=").append(habit);
        sb.append(", score=").append(score);
        sb.append(", age=").append(age);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}